Field of the Invention
The present invention relates to a distance information processing apparatus, an imaging apparatus, a distance information processing method and a program.
Description of the Related Art
In an imaging apparatus, such as a digital still camera and a digital video camera, an imaging apparatus having a ranging function has been proposed, where a distance from the imaging apparatus to an object (object distance) can be acquired at a plurality of pixel positions at the same time with acquiring an ornamental image signal (an image signal constituted by object distances acquired at a plurality of pixel positions is hereafter called “distance image signal”).
For example, Japanese Patent No. 4915126 discloses a solid-state imaging element where a pixel, having a ranging function, is disposed in a part of or in all of the pixels of the imaging element, and the object distance is detected by the phase difference method. The ranging method disclosed in Japanese Patent No. 4915126 is called “imaging plane phase difference ranging method”, since phase difference type ranging is performed on the imaging plane. If the solid-state imaging element according to Japanese Patent No. 4915126 is used, at least two image signals can be acquired based on the images generated by luminous flux which passed through different pupil regions within an imaging optical system of the imaging apparatus. A relative positional shift amount between the two image signals is detected by a method similar to a parallax detection method using stereo images, and is converted into a defocus amount via a predetermined conversion coefficient, whereby the object distance can be acquired. Further, according to the imaging plane phase difference ranging method, an ornamental image signal can be generated by combining two image signals. Another ranging method, referred to as the depth from defocus (DFD) method, is disclosed in Japanese Patent No. 2756803. The DFD method is a ranging method where two image signals are consecutively acquired in a time series with changing the photographing conditions (e.g. diaphragm stop, focal length), and the object distance is acquired from the difference of blur amounts between the two images. In the DFD method, one of the two image signals can be used as an ornamental image signal.
In the case of the imaging apparatus having the ranging function, the depth of field and focus position can be controlled after an image is acquired by performing image processing on the ornamental image signal based on the distance image signal. Further, a number of individuals can be accurately measured by extracting an individual in a space based on the distance range of the object calculated from the ornamental image signal and distance image signal.
In all these object distance calculation methods, the object distance is calculated based on the correlation of the two image signals. When a correlation is evaluated, normally a region-based matching method is used. In the region-based matching method, an image signal included in a predetermined collation region is extracted from each image signal to evaluate the correction. If correlation of the two images is accurately evaluated, the object distance can be acquired at high precision, but if not, an incorrect object distance may be calculated.
Japanese Patent No. 4537597 discloses a method of separating a region where the correlation is evaluated incorrectly, and a region where the correlation is evaluated correctly. In Japanese Patent No. 4537597, an upper layer matching unit evaluates the correlation among image signals using a predetermined collation region, and a lower layer matching unit evaluates correlation for each divided collation region generated by dividing the collation region. According to the method disclosed in Japanese Patent No. 4537597, it is determined that the correlation is not evaluated correctly when the result of evaluating the correlation in the upper layer and the result of evaluating the correlation in the lower layer do not match.
Patent Document 1: Japanese Patent No. 4915126
Patent Document 2: Japanese Patent No. 2756803
Patent Document 3: Japanese Patent No. 4537597